Skip to content

Conversation

philnik777
Copy link
Contributor

aligned_storage has been deprecated and will most likely be removed in a future version of C++. This patch removes some of its uses to avoid having to work around its removal in the future.

Copy link

github-actions bot commented Oct 2, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@philnik777 philnik777 force-pushed the remove_aligned_storage branch from ff4ed62 to 6dae88f Compare October 7, 2025 12:39
@philnik777 philnik777 marked this pull request as ready for review October 7, 2025 12:39
@philnik777 philnik777 requested a review from a team as a code owner October 7, 2025 12:39
_LIBCPP_SUPPRESS_DEPRECATED_PUSH
using _Buffer _LIBCPP_NODEBUG = aligned_storage_t<3 * sizeof(void*), alignof(void*)>;
_LIBCPP_SUPPRESS_DEPRECATED_POP
inline constexpr size_t __small_buffer_size = 3 * sizeof(void*);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found the previous code easier to read since we did sizeof(_Buffer) and alignof(_Buffer) below. What would you think of using _Buffer = alignas(alignment) char [size] instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't put alignas on an alias.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants